<?php
/**
 * @date        <!-- phpDesigner :: Timestamp [08-07-2010 16:53:13] -->
 * @filesource  component.user.php
 * @package     WebCms
 * @copyright	Copyright (C) 2010
 * @author      Sérgio 'Horizak' Alves
 */

// Sem acesso directo
defined('_WEXEC') or die('Restricted access');

require (dirname(__file__).DS.'class.user.php');

// Inclui o ficheiro de idioma
$this->_getLang('component.user');

$this->_loadComponent('User');

$output = false;

if(isset($this->global['get']['a'])) {
  switch($this->global['get']['a']) {
    case 'register':
      if(!$this->obj['user']->logged()) {
        $output = true;
        if($this->obj['component']->params['allowRegister'] == 'yes') $this->obj['component']->show('component.user.register.tpl');
        else  $this->_showError(L_NOTALLOWREGISTER);
      }
      break;
    case 'recoverpw':
      if(!$this->obj['user']->logged()) {
        $output = true;
        $this->obj['component']->show('component.user.recoverpw.tpl');
      }
      break;
  }
}

if(!$output) $this->obj['component']->userPage();
unset($output);
?>